package com.liuyi.usercenterservice.exception;

import com.liuyi.usercenterservice.common.BaseResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 刘燚
 * @version v1.0.0
 * @Description TODO
 * @createDate：2024/3/27 19:52
 * @email liuyia2022@163.com
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(BusinessException.class)
    public BaseResponse BusinessExceptionHandler(BusinessException e){
        return new BaseResponse(e.getCode(),e.getMessage(),e.getDescription());
    }
}
